<?php
 function load_yaml($filename, $cacheEnabled = true, $replace = null) { static $objects = array(); if (!file_exists($filename)) { FLEA::loadClass('FLEA_Exception_ExpectedFile'); return __THROW(new FLEA_Exception_ExpectedFile($filename)); } if ($cacheEnabled) { $arr = FLEA::getCache('yaml-' . $filename, filemtime($filename), false); if ($arr) { return $arr; } } if (!isset($objects[0])) { require_once FLEA_3RD_DIR . '/Spyc/spyc.php'; $objects[0] =& new Spyc(); } $arr = $objects[0]->load($filename, $replace); if ($cacheEnabled) { FLEA::writeCache('yaml-' . $filename, $arr); } return $arr; } 